using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
using SalesPages.DomainModel;

namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class AgeGroup_lkpMap : EntityTypeConfiguration<AgeGroup_lkp>
    {
        public AgeGroup_lkpMap()
        {
            // Primary Key
            this.HasKey(t => t.Code);

            // Properties
            this.Property(t => t.Code)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.Descr)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("AgeGroup_lkp");
            this.Property(t => t.Code).HasColumnName("Code");
            this.Property(t => t.Descr).HasColumnName("Descr");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
        }
    }
}
